This invention relates generally to the use of fonts by a computer for display-and printing, and more particularly to the process of loading fonts during the initialization of an operating system.
Various font technologies are used today in operating systems for the display of text on output devices, such as computer display screens and printers. Examples of commonly used font technologies include TrueType fonts, PostScript fonts, bitmap fonts, and vector fonts.
With the significant improvements in computer hardware and software capabilities in the past decade, a computer nowadays may support a large number of fonts for different languages. Font-intensive applications, such as word processors and desktop or web publishing applications, may require thousands of fonts to be loaded on a computer. To simplify the task of loading font data each time the computer is booted, some operating systems allow xe2x80x9cpermanentxe2x80x9d installation of fonts, i.e., the computer will automatically load the permanently installed fonts during the boot time. To that end, the path to the font file of each installed font may e stored in a file or in the Registry of the operating system. During the boot time, the operating system goes through the list of installed fonts and retrieves information from each of the font files and makes the fonts available to applications. The operation of retrieving information from the font files so that the fonts can be later used by the operating system for display or printing is commonly referred to as xe2x80x9cloadingxe2x80x9d the fonts.
Depending on the font technologies used, the font loading operation can be quite time consuming. To load a font, the operating system needs to first determine the type of the font by doing at least basic consistency checking of the structure of the font. Moreover, to actually load the font, the operating system needs to extract information from the font file that enables it to use the font, and store the extracted information in the system memory for quick access. The extraction of information from a font file may involve reading the entire font file and performing intensive calculations on the data in the font file. Reading data from disk files, however, is a very slow I/O operation. Thus, a significant amount of time may be spent on reading font files during the font-loading process, especially when the information needed from a font file is scattered randomly on a mass storage device with a long access time, such as a hard disk. This is especially the case for Fast East fonts, the font files of some of which may be up to 20 megabytes (MB) in size. With a large font file, many xe2x80x9cpagesxe2x80x9d (i.e., chunks of a predefined size, such as 4 KB) need to be read into the computer memory from the disk in order to extract all the information that is needed by the operating system.
When a large number, such as a few thousands, of fonts are to be loaded, the process of extracting information from the font files can take a long time, sometimes on the order of tens of minutes. Because loading fonts is part of the computer boot process, the slow font-loading process significantly lengthens the time required to boot the computer. To many computer users, it is a great annoyance to have to wait for a long time for the computer to boot itself.
In view of the foregoing, the present invention provides a method and system for efficiently loading fonts at the boot time of a computer or when an instance of the graphics component of the operating system is initialized. In accordance with the invention, a font-loading information cache file is provided for storing font-loading information of fonts installed on the computer. The font-loading information, which is needed by the operating system to be able to use the fonts, is extracted and/or calculated from the font file for each installed font and stored in the font-loading cache when that font was installed. During the boot time of the computer, the operating system goes through the list of installed fonts. For each installed font, the operating system requests an associated font driver to load the font. The font driver determines whether the font-loading information for that font has been stored in the font-loading information cache file. If the font-loading information for the font is in the cache file, the font driver retrieves the information from the cache file for use by the operating system. This font-loading information caching scheme is also applicable in a remote terminal server system where an instance of the graphic component of the operating system is initialized and the installed fonts are reloaded for each remote terminal session.
Additional features and advantages of the invention will be made apparent from the following detailed description of illustrative embodiments, which proceeds with reference to the accompanying figures.